package net.dntuan.training.spring.integration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;

/**
 * @author tuan.dangnhu
 * 
 * $LastChangedRevision: 120 $
 * $LastChangedDate: 2014-10-04 09:25:09 +0000 (Sat, 04 Oct 2014) $
 * $LastChangedBy: dnhutuan@gmail.com $
 */
public class SimpleBean implements DisposableBean {

  private static final Logger logger = LoggerFactory.getLogger(SimpleBean.class);

  public SimpleBean() {
    logger.info("SimpleBean: hashcode " + this.hashCode());
  }

  /**
   * At the time an instance of this object is removed from the object pool, this method will be called to release resource
   */
  @Override
  public void destroy() {
    logger.info("do something to release all resource...");
    logger.info("destroy bean with hashcode " + this.hashCode());
  }
}
